<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js"></script>
		<style></style>
	</head>
	<body>
		<div id="box">
			<ul>
				<li v-for="(item,index) in list" :class="current===index?'active':''" @click="change(index)">
					{{item}}
				</li>
			</ul>
		</div>
		<script>
		var vm = new Vue({
            el:"#box",
            data:{
                list:["首页","商品","详情"],
                current:0
            },
            methods:{
                change(index){ 
                    this.current = index;
                } 
            }
        });
		</script>
	</body>
</html>